package com.pjj.projectservice.service;

import com.pjj.projectservice.entity.Project;
import com.pjj.projectservice.entity.Team;
import java.util.Map;

/**
 * @author 76004
 * @apiNote
 * @date 2023/2/28 17:28
 */
public interface ProjectService {
    /***
     * 按照id查询
     * @param projectId
     * @return
     */
    public Object selectById(Long projectId);

    /***
     * 分页查询所有项目
     * @param pageNum
     * @param pageSize
     * @return
     */
    public Object selectPage(int pageNum,int pageSize);

    /***
     * 按照id删除project
     * @param id
     * @return
     */
    public Object deleteById(Long id);

    /***
     * 更新项目信息
     * @param project
     * @return
     */
    public Object updateProject(Project project);

    /***
     * 查询项目成员id
     * @param id
     * @return
     */
    public Object selectProjectMemberId(Long id);

    /***
     * 添加项目成员
     * @param team
     * @return
     */
    public Object addProjectMember(Team team);

    /***
     * 按照userId查询project
     * @param id
     * @return
     */
    public Object selectProjectByUserId(String id);

    /***
     * 查询项目数量
     * @return
     */
    public Object selectProjectCount();

    /***
     * 高级人员立项，指定组长
     * @param project
     * @return
     */
    public Map<String,Object> makeProjectByHighAuthority(Project project);

    /***
     * 组长立项
     * @param project
     * @return
     */
    public Map<String,Object> makeProjectByLeader(Project project);

    /***
     * 创建项目加入凭证code
     * @param projectId
     * @param timeout 过期时间，hour
     * @return
     */
    public Map<String,Object> makeProjectAccessCode(long projectId, long timeout);

    /***
     * 关闭项目加入凭证code
     * @param projectId
     * @return
     */
    public Map<String,Object> makeNoProjectAccessCode(long projectId);

    /***
     * 按照code加入组
     * @param userId
     * @param code
     * @return
     */
    public Map<String,Object> joinProjectByCode(String userId,String code);

    /***
     * 剔除成员
     * @param removeUserId
     * @param projectId
     * @param requestUserId
     * @return
     */
    public Map<String,Object> removeMemberById(String removeUserId, Long projectId, String requestUserId);

    /***
     * 成员主动退出
     * @param userId
     * @param projectId
     * @return
     */
    public Map<String,Object> exitProjectById(String userId, Long projectId);

    /***
     * 验证权限
     * @param userAuthority
     * @param minAuthority
     * @return
     */
    public Boolean authorityVerify(Integer userAuthority, Integer minAuthority);

    /***
     * 项目结束
     * @param userId
     * @param projectId
     * @return
     */
//    public Map<String,Object> completeProject(String userId,Long projectId);

}
